/*
 * $Id: error.h,v 1.26.2.2 Broadcom SDK $
 * 
 * $Copyright: Copyright 2011 Broadcom Corporation.
 * This program is the proprietary software of Broadcom Corporation
 * and/or its licensors, and may only be used, duplicated, modified
 * or distributed pursuant to the terms and conditions of a separate,
 * written license agreement executed between you and Broadcom
 * (an "Authorized License").  Except as set forth in an Authorized
 * License, Broadcom grants no license (express or implied), right
 * to use, or waiver of any kind with respect to the Software, and
 * Broadcom expressly reserves all rights in and to the Software
 * and all intellectual property rights therein.  IF YOU HAVE
 * NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE
 * IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
 * ALL USE OF THE SOFTWARE.  
 *  
 * Except as expressly set forth in the Authorized License,
 *  
 * 1.     This program, including its structure, sequence and organization,
 * constitutes the valuable trade secrets of Broadcom, and you shall use
 * all reasonable efforts to protect the confidentiality thereof,
 * and to use this information only in connection with your use of
 * Broadcom integrated circuit products.
 *  
 * 2.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS
 * PROVIDED "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
 * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
 * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE.  BROADCOM SPECIFICALLY
 * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
 * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
 * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
 * CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING
 * OUT OF USE OR PERFORMANCE OF THE SOFTWARE.
 * 
 * 3.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL
 * BROADCOM OR ITS LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL,
 * INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY DAMAGES WHATSOEVER
 * ARISING OUT OF OR IN ANY WAY RELATING TO YOUR USE OF OR INABILITY
 * TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF
 * THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR USD 1.00,
 * WHICHEVER IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING
 * ANY FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.$
 * 
 * DO NOT EDIT THIS FILE!
 * This file is auto-generated.
 * Edits to this file will be lost when it is regenerated.
 */

#ifndef __BCM_ERROR_H__
#define __BCM_ERROR_H__

#include <shared/error.h>

/* 
 * BCM API error codes.
 * 
 * Note: An error code may be converted to a string by passing the code
 * to bcm_errmsg().
 */
typedef enum bcm_error_e {
    BCM_E_NONE = _SHR_E_NONE, 
    BCM_E_INTERNAL = _SHR_E_INTERNAL, 
    BCM_E_MEMORY = _SHR_E_MEMORY, 
    BCM_E_UNIT = _SHR_E_UNIT, 
    BCM_E_PARAM = _SHR_E_PARAM, 
    BCM_E_EMPTY = _SHR_E_EMPTY, 
    BCM_E_FULL = _SHR_E_FULL, 
    BCM_E_NOT_FOUND = _SHR_E_NOT_FOUND, 
    BCM_E_EXISTS = _SHR_E_EXISTS, 
    BCM_E_TIMEOUT = _SHR_E_TIMEOUT, 
    BCM_E_BUSY = _SHR_E_BUSY, 
    BCM_E_FAIL = _SHR_E_FAIL, 
    BCM_E_DISABLED = _SHR_E_DISABLED, 
    BCM_E_BADID = _SHR_E_BADID, 
    BCM_E_RESOURCE = _SHR_E_RESOURCE, 
    BCM_E_CONFIG = _SHR_E_CONFIG, 
    BCM_E_UNAVAIL = _SHR_E_UNAVAIL, 
    BCM_E_INIT = _SHR_E_INIT, 
    BCM_E_PORT = _SHR_E_PORT 
} bcm_error_t;

/* Switch event types */
typedef enum bcm_switch_event_e {
    BCM_SWITCH_EVENT_IO_ERROR = _SHR_SWITCH_EVENT_IO_ERROR, 
    BCM_SWITCH_EVENT_PARITY_ERROR = _SHR_SWITCH_EVENT_PARITY_ERROR, 
    BCM_SWITCH_EVENT_THREAD_ERROR   = _SHR_SWITCH_EVENT_THREAD_ERROR, 
    BCM_SWITCH_EVENT_ACCESS_ERROR   = _SHR_SWITCH_EVENT_ACCESS_ERROR, 
    BCM_SWITCH_EVENT_ASSERT_ERROR   = _SHR_SWITCH_EVENT_ASSERT_ERROR, 
    BCM_SWITCH_EVENT_STABLE_FULL   = _SHR_SWITCH_EVENT_STABLE_FULL, 
    BCM_SWITCH_EVENT_STABLE_ERROR   = _SHR_SWITCH_EVENT_STABLE_ERROR, 
    BCM_SWITCH_EVENT_UNCONTROLLED_SHUTDOWN   = _SHR_SWITCH_EVENT_UNCONTROLLED_SHUTDOWN, 
    BCM_SWITCH_EVENT_WARM_BOOT_DOWNGRADE   = _SHR_SWITCH_EVENT_WARM_BOOT_DOWNGRADE, 
    BCM_SWITCH_EVENT_TUNE_ERROR = _SHR_SWITCH_EVENT_TUNE_ERROR, 
    BCM_SWITCH_EVENT_ALARM = _SHR_SWITCH_EVENT_ALARM 
} bcm_switch_event_t;

#define BCM_SUCCESS(rv)         \
    _SHR_E_SUCCESS(rv) 

#define BCM_FAILURE(rv)         \
    _SHR_E_FAILURE(rv) 

#define BCM_IF_ERROR_RETURN(op)  \
    _SHR_E_IF_ERROR_RETURN(op) 

#define BCM_IF_ERROR_NOT_UNAVAIL_RETURN(op)  \
    _SHR_E_IF_ERROR_NOT_UNAVAIL_RETURN(op) 

#define bcm_errmsg(rv)          \
    _SHR_ERRMSG(rv) 

#endif /* __BCM_ERROR_H__ */
